/**
 * 
 */
package com.wskj.library.user.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wskj.library.service.UserService;
import com.wskj.library.service.impl.UserServiceImpl;
import com.wskj.util.StringUtil;

/**
 * @author 胡洋
 * @describe 
 * @Date 2018年3月22日下午6:09:59
 * @version 1.0
 */
@WebServlet(urlPatterns="/reader/delete.do")
public class DeleteUserServlet extends HttpServlet {
	private  UserService userService=new UserServiceImpl();		
	
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	    int id=StringUtil.nullToInt(req.getParameter("id"));	    
	    boolean result=userService.deleteUserById(id);		
		resp.sendRedirect(req.getContextPath()+"/reader/list.do");
	}
}
